public class Person implements Comparable{
    private String name;
    private int age;
    public Person(String name, int age){
        this.name=name;
        this.age=age;
    }
    @Override
    public int compareTo(Object o) {
        if(o instanceof Person){
            Person other = (Person)o;
            if(this.age>other.age)
                return -1;
            else if(this.age<other.age)
                return 1;
            else
                return this.name.compareTo(other.name);
        }
        return 0;
    }
    public String getInfo(){
        return this.name+":"+this.age;
    }
}